<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $this->view->omg = 200;
        $create = new Application_Model_Register();
        
        $geta = $create->getEntry(1);                                 /*Get One Entry*/
        $this->view->ind = $geta[0];

        
//        $create->deleteEntry(2);                                      /*Delete Entry*/
        
        
//        $create->createEntry(array(                                    /*Create Entry*/
//            'title'=>'6th',
//            'body'=>'This is 6th entry'
//        ));
//        $create->updateEntry(array(                                   /*Update Entry*/
//            'title'=>'5th',
//            'body'=>'5th entry is updated'
//        ),5);
        
        
        $fetchall = $create->fetchAll();
        $this->view->fall = $fetchall;
        
        
    }

    public function newoneAction() {
        
        mysql_connect('localhost','savan','savan') or die(mysql_error());
        mysql_select_db('blog') or die(mysql_error());
        $result = mysql_query("select * from comments") or die(mysql_error());
        while($row = mysql_fetch_array($result)){
            echo '<b>'.$row['id'].'</b>---'.$row['entry_id'].'---'.$row['body'].'<br>';
        }
    }
  
}

